﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucShoppingCart.ascx.cs"
    Inherits="Client_UserControl_ucShoppingCart" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<style type="text/css">
    .style1
    {
        height: 47px;
    }
</style>
<asp:Panel ID="pnlViewCart" runat="Server">
    <asp:UpdatePanel ID="pnlShoppingCart" runat="server">
        <ContentTemplate>
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td id="tdShoppingCart" runat="server" class="">
                        Bạn có<asp:Label ID="lblNumber" runat="server" ForeColor="#2088d8" Font-Bold="true"
                            Text="0 sản phẩm" />&nbsp;trong giỏ hàng.
                    </td>
                </tr>
                <tr>
                    <td style="padding-top: 10px;">
                        <asp:GridView ID="grdShoppingCart" runat="server" AutoGenerateColumns="False" CellPadding="10"
                            CssClass="grd" OnRowDataBound="grdShoppingCart_RowDataBound">
                            <Columns>
                                <asp:TemplateField HeaderText="Sản Phẩm">
                                    <ItemTemplate>
                                        <asp:Image ID="imgProduct" runat="server" ImageUrl='<%# "~/ImageProcess.ashx?file=" + "~/Admin/images/items/" + Eval("Items.ImageURL") + "&width=100&heigh=100&dd=true" %>' /></ItemTemplate>
                                    <ItemStyle Height="70" VerticalAlign="Middle" HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Tên Sản Phẩm">
                                    <ItemTemplate>
                                        <%# Eval("Items.ItemNumber") %><br />
                                        <%# Eval("Items.ItemName")%></ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" Wrap="True" Font-Bold="true" Width="355px"></ItemStyle>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Giá">
                                    <ItemTemplate>
                                        <asp:Label ID="lblPrice" runat="server" CssClass="clsPriceCart" Text='<%# Eval("Price") %>'></asp:Label><asp:Label
                                            ID="lblMatchedPrice" runat="server" CssClass="clsPriceCartMatched" Text="0"></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle Width="60" VerticalAlign="Middle" HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Số Lượng">
                                    <ItemTemplate>
                                        <asp:UpdatePanel ID="updatePnlQuantity" runat="server">
                                            <ContentTemplate>
                                                <table border="0" cellpadding="0" cellspacing="0">
                                                    <tr>
                                                        <td style="padding: 20px 0 0 4px;">
                                                            <asp:ImageButton ID="btnQuantityDn" runat="server" ImageUrl="~/images/quantityDn.png"
                                                                OnClick="btnQuantity_Click" SkinID="btnDn" />
                                                        </td>
                                                        <td>
                                                            &nbsp;
                                                        </td>
                                                        <td style="padding-top: 20px;">
                                                            <asp:TextBox ID="txtQuantity" runat="server" Text='<%# Eval("Quantity") %>' ToolTip='<%# Eval("Quantity") %>'
                                                                Width="30" CssClass="txtQuantity" AutoPostBack="true" OnTextChanged="txtQuantity_TextChanged" />
                                                        </td>
                                                        <td style="padding: 20px 0 0 4px;">
                                                            <asp:ImageButton ID="btnQuantityUp" runat="server" ImageUrl="~/images/quantityUp.png"
                                                                OnClick="btnQuantity_Click" SkinID="btnUp" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="3" align="center" style="padding-top: 3px;">
                                                            <asp:UpdateProgress ID="updatePnlProgress" runat="server" DynamicLayout="false" AssociatedUpdatePanelID="updatePnlQuantity">
                                                                <ProgressTemplate>
                                                                    <asp:Image ID="imgUpdatingSmall" runat="server" ImageUrl="~/images/ajaxLoading.gif" />
                                                                </ProgressTemplate>
                                                            </asp:UpdateProgress>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="txtQuantity" EventName="TextChanged" />
                                                <asp:AsyncPostBackTrigger ControlID="btnQuantityDn" EventName="Click" />
                                                <asp:AsyncPostBackTrigger ControlID="btnQuantityUp" EventName="Click" />
                                            </Triggers>
                                        </asp:UpdatePanel>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" Width="50px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Thành tiền">
                                    <ItemTemplate>
                                        <asp:UpdatePanel ID="updatePnlGrid" runat="server">
                                            <ContentTemplate>
                                                <asp:Label ID="lblSubTotal" runat="server" CssClass="clsSubTotalPriceCart"></asp:Label>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </ItemTemplate>
                                    <ItemStyle Width="90" VerticalAlign="Middle" HorizontalAlign="Right" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Xóa">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgDelete" runat="server" ImageUrl="~/Admin/images/table/del.gif"
                                            OnClick="imgDelete_Click" Style="display: block;" ToolTip="Xóa" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle CssClass="grdHeader" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle CssClass="grdAlternateRow" />
                            <RowStyle CssClass="grdRow" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
            <asp:Panel ID="pnlCartFooter" runat="server" Height="191px">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td style="text-align: right; padding: 10px 0 0 0;">
                           <strong><asp:Label ID="test_tong" runat="server" Text="Thành tiền: " CssClass="clsTotalPriceCart"></asp:Label>
                            <asp:Label ID="lblTotal" runat="server" CssClass="clsTotalPriceCart"></asp:Label>
                            <span>VND </span>&nbsp;(Đã bao gồm VAT)</strong> 
                        </td>
                    </tr>
                    <tr>
                        <td style="padding: 10px 0 10px 0; text-align: right;" class="style1">
                            <asp:ImageButton ID="imgBtnCheckOut" runat="server" ToolTip="Check out" ImageUrl="~/images/button/bt_checkout.png"
                                OnClick="imgBtnCheckOut_Click" />
                                
                            
                        </td>
                    </tr>
                    <tr>
                        <td style="padding: 10px 0 10px 0; text-align: right;">
                            <asp:Label ID="lblCheckOutInfo" runat="server" Text=""></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Image ID="paypal" runat="server" ToolTip="Paypal" ImageUrl="~/images/acb.jpg" />
                            <asp:Image ID="imgPaymentMaster" runat="server" Height="40px" ToolTip="Master" ImageUrl="~/images/DongA_Bank.jpg"
                                Width="100px" />
                            <asp:Image ID="imgPaymentVisa" runat="server" ToolTip="Visa" ImageUrl="~/images/vietcombank.jpeg"
                                Height="40px" Width="164px" />
                            <asp:Image ID="imgPaymentAmericanExpress" runat="server" ToolTip="American Express"
                                ImageUrl="~/images/techcombank.jpg" Height="40px" Width="174px" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>
